/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javasetcollection;

/**
 *
 * @author human
 */
public class User extends Object{
    
    private static int count = 87870;
    private int id = count;
    private String name;
    private String surname;

    public User(String name, String surname) {
        this.name = name;
        this.surname = surname;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getSurname() {
        return surname;
    }

    @Override
    public int hashCode() {
        return id;
    }
    
    @Override
    public boolean equals(Object o) {
        User user = (User)o;
        return (user.id == this.id);
    }

    @Override
    public String toString() {
        return getClass().getName() + "@" + Integer.toHexString(id);
    }
}
